package com.nectech.util;

import com.nectech.constant.Constant;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;

/**
 * @Author: 浅小北
 * @ClassName: GameUtil
 * @Description: 英雄动作图片组
 * @Date: 2021/1/27 10:45
 * @Since: version-1.0
 */
public class GameUtil {
    private GameUtil(){};
    public static Image getImage(String imgPath) {
        URL url = ImageUtil.class.getClassLoader().getResource(Constant.IMAGE_PATH_PRE + imgPath +Constant.IMAGE_PATH_SUF);
        BufferedImage img = null;
        try {
            img = ImageIO.read(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return img;
    }

   /* public static Image getImage_bg(String imgPath) {
        URL url = ImageUtil.class.getClassLoader().getResource(Constant.IMAGE_PATH_PRE + imgPath);
        BufferedImage img = null;
        try {
            img = ImageIO.read(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return img;
    }*/
}
